package com.kgcx.organization.service;

import com.kgcx.organization.domain.CompanyScale;
import com.kgcx.organization.rabbitmq.producer.CompanyScaleProducer;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 公司运营规模数据服务
 * @author qinze
 *
 */
@Service
public class CompanyScaleService {
	
	@Resource
	private DriverService driverService;
	@Resource
	private AutoService autoService;
	@Resource
	private CompanyScaleProducer companyScaleProducer;
	
	public void companyScale () {
		int dricerCount = driverService.selectDriverCount();
		int autoCount = autoService.autoCount();
		CompanyScale companyScale = new CompanyScale();
		companyScale.setDriverNum(dricerCount);
		companyScale.setVehicleNum(autoCount);
		companyScaleProducer.addCompanyScaleProducer(companyScale);
	}
}
